/************************************************************************************
* YLog.h                                                                            *
*                                                                                   *
* Copyright (C) 2011 Varuna L Amachi                                                *
*                                                                                   *
* This program is free software; you can redistribute it and/or modify              *
* it under the terms of the GNU General Public License as published by              *
* the Free Software Foundation; either version 2 of the License, or any             *
* later version.                                                                    *
*                                                                                   *
* This program is distributed in the hope that it will be useful, but               *
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY        *
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for       *
* more details. You should have received a copy of the GNU General Public           *
* License along with this program; if not, write to the Free Software Foundation,   *
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                       *
*                                                                                   *
*************************************************************************************/

#ifndef YLOG_H
#define YLOG_H

#include <QString>
#include <QDebug>
#include <QSqlQuery>
#include <QSqlError>

class YLog
{
public:
    enum LogLevel {
        DEBUG,
        INFO,
        WARNING,
        ERROR,
        FATAL
    };
    static void setLevel(LogLevel level);
    static void log(LogLevel level, QString message);
    static void logDebug(QString message);
    static void logInfo(QString message);
    static void logError(QString message);
    static void logWarning(QString message);
    static void logFatal(QString message);

    static void logQuery(QString queryId, QSqlQuery *query);

private:
    YLog(){}
    static LogLevel c_logLevel;
};

#endif // YLOG_H
